package pe.edu.upc.e41a.javasoft.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pe.edu.upc.e41a.javasoft.domain.Transaccion;


@Service
@Transactional
public class TransaccionServiceImpl implements TransaccionService {

	public long countAllTransaccions() {
        return Transaccion.countTransaccions();
    }

	public void deleteTransaccion(Transaccion transaccion) {
        transaccion.remove();
    }

	public Transaccion findTransaccion(Integer id) {
        return Transaccion.findTransaccion(id);
    }

	public List<Transaccion> findAllTransaccions() {
        return Transaccion.findAllTransaccions();
    }

	public List<Transaccion> findTransaccionEntries(int firstResult, int maxResults) {
        return Transaccion.findTransaccionEntries(firstResult, maxResults);
    }

	public void saveTransaccion(Transaccion transaccion) {
        transaccion.persist();
    }

	public Transaccion updateTransaccion(Transaccion transaccion) {
        return transaccion.merge();
    }
}
